package com.neusoft.yuejian_6.activity;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.neusoft.yuejian_6.R;
import com.neusoft.yuejian_6.javabean.About;
import com.neusoft.yuejian_6.model.AboutModel;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class GuanyuActivity extends Activity {


    private TextView about_intro;
    private int about_id;
    private ImageView back;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_guanyu);
        initView();
        initData();
        initEvent();


    }


    private void initView() {

        about_intro = (TextView) findViewById(R.id.about_intro);
        back=(ImageView) findViewById(R.id.back);
    }


    private  void initEvent(){
        back.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }



    public void initData(){
        // SharedPreferences sp=getActivity().getSharedPreferences("aboutInfo", Context.MODE_PRIVATE);
        // about_id = sp.getInt("about_id",0);
        // Log.d("userbg","u_id");

        AboutModel aboutModel = new AboutModel();
        Call call = aboutModel.getAboutInfo(about_id);
        call.enqueue(new Callback<About>() {
            @Override
            public void onResponse(Call<About> call, Response<About> response) {
                About about = response.body();
                //  about_intro.setText(about.getAbout_intro());
                // Log.d("userbg","username");

            }

            @Override
            public void onFailure(Call<About> call, Throwable t) {
            }
        });
    }

}

/**
 * ATTENTION: This was auto-generated to implement the App Indexing API.
 * See https://g.co/AppIndexing/AndroidStudio for more information.
 */


